import request from '@/utils/request'

// 查询AI摄像头列表
export function listSurveillance(query) {
  return request({
    url: '/wvp/surveillance/list',
    method: 'get',
    params: query
  })
}

// 查询AI摄像头详细
export function getSurveillance(id) {
  return request({
    url: '/wvp/surveillance/' + id,
    method: 'get'
  })
}

// 新增AI摄像头
export function addSurveillance(data) {
  return request({
    url: '/wvp/surveillance',
    method: 'post',
    data: data
  })
}

// 修改AI摄像头
export function updateSurveillance(data) {
  return request({
    url: '/wvp/surveillance',
    method: 'put',
    data: data
  })
}

// 删除AI摄像头
export function delSurveillance(id) {
  return request({
    url: '/wvp/surveillance/' + id,
    method: 'delete'
  })
}
//刷新所有摄像头状态
export function syncDeviceStatus(id) {
  return request({
    url: '/wvp/surveillance/syncDeviceStatus',
    method: 'post'
  })
}
// 实时监控摄像头
export function getLiveInfo(id) {
  return request({
    url: '/wvp/surveillance/live/'+id,
    method: 'post',
    data: {}
  })
}
// 监控摄像头回放
export function getHistoryLiveInfo(id,params={}) {
  params.protocol=4;
  return request({
    url: '/wvp/surveillance/historyLiv/'+id,
    method: 'post',
    data: params
  })
}
// 监控摄像头回放
export function getEventList(id,data) {
  return request({
    url: '/wvp/surveillance/eventList/'+id,
    method: 'post',
    data: data
  })
}

